package cn.itsource.ymcc.client;

import cn.itsource.ymcc.doc.CourseDoc;
import cn.itsource.ymcc.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = SearchClientFallbackFactory.class)
public interface SearchClient {
    /**
     * 批量新增/修改
     * @param courseDocs
     * @return
     */
    @PostMapping("/search/saveBatch")
    JsonResult saveBatch(@RequestBody List<CourseDoc> courseDocs);

    /**
     * 批量删除
     * @param courseIds
     * @return
     */
    @DeleteMapping("/search/deleteBatch")
    JsonResult deleteBatch(@RequestBody List<Long> courseIds);
}
